package com.wholeintech.entity;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

/**
 * Created by Lyle on 2016-02-26.
 */


@Table(name = "DeviceDataBase")
public class DeviceDb extends EntityBase {

    @Column(name = "regionId")
    private int regionId = 0;
    @Column(name = "boxId")
    private String boxId = "";

    @Column(name = "devId")
    private String devId = "";

    @Column(name = "gwDevId")
    private String gwDevId = "";

    @Column(name = "name")
    private String name = "";

    @Column(name = "netType")
    private int netType = 0;

    @Column(name = "type")
    private int type = 0;

    @Column(name = "macAddr")
    private String macAddr = "";

    @Column(name = "status")
    private int status;// device online or offline

    // Smart Light
    @Column(name = "sw")
    private int sw = 0;
    @Column(name = "brightness")
    private int brightness = 0;
    @Column(name = "color")
    private int color = 0;
    @Column(name = "dimmer")
    private int dimmer = 0;// 可调光标记

    // Smart Curtain
    @Column(name = "runstate")
    private int runstate = 0; /* stop:0,forward:1,reverse:2 */

    @Column(name = "runstate2")
    private int runstate2 = 0;

    // Air-condition
    // private boolean aSw=false;
    @Column(name = "mode")
    private int mode = 0; //
    @Column(name = "temperature")
    private int temperature = 25;
    @Column(name = "wind")
    private int wind = 0;
    @Column(name = "wipe")
    private int wipe = 0;

    // Sensor
    // private float tbTemp=0;
    // private int tbHum=0;
    @Column(name = "pir")
    private int pir = 0;
    @Column(name = "ambientLight")
    private int ambientLight = 0;
    // end TopBox

    // airRadio Sensor
    @Column(name = "TEMP")
    private int TEMP = 0;

    @Column(name = "HUM")
    private int HUM = 0;

    @Column(name = "CO2")
    private int CO2 = 0;

    @Column(name = "PM25")
    private int PM25 = 0;

    @Column(name = "VOC")
    private int VOC = 0;

    // fresh air
    // private boolean fAsw=false;
    @Column(name = "panel")
    private int panel = 0;

    public int getPanel() {
        return panel;
    }

    public void setPanel(int panel) {
        this.panel = panel;
    }

    @Column(name = "fbFlag")
    private int fbFlag = 0;
    @Column(name = "retryCnt")
    private int retryCnt = 0;

    // alone Sensor
    @Column(name = "state")
    private int state = 0;

    @Column(name = "devCongfigure")
    private String devCongfigure = "00000000";

    @Column(name = "bindSw1")
    private String bindSw1;

    @Column(name = "bindSw2")
    private String bindSw2;

    public DeviceDb() {
    }

    public DeviceDb(String boxId, String devId, String devName, int netType,
                    int devType, String mac) {
        this.name = devName;
        this.type = devType;
        this.netType = netType;
        this.macAddr = mac;
        // this.netAddr = netAddr;
        this.devId = devId;
        this.boxId = boxId;
        // if (devType == DeviceList.TYPE_SWITCH)
        // swBindAddrList = new ArrayList();
    }

    public DeviceDb(String boxId, String devId, String devName, int netType,
                    int devType, String mac, int regionId) {
        this.name = devName;
        this.type = devType;
        this.netType = netType;
        this.macAddr = mac;
        // this.netAddr = netAddr;
        this.devId = devId;
        this.boxId = boxId;
        this.regionId = regionId;
        // if (devType == DeviceList.TYPE_SWITCH)
        // swBindAddrList = new ArrayList();
    }

    public DeviceDb(String boxId, String devId, String devName, int netType,
                    int devType, String mac, String bindSw1, String bindSw2,
                    int regionId) {
        this.name = devName;
        this.type = devType;
        this.netType = netType;
        this.macAddr = mac;
        // this.netAddr = netAddr;
        this.devId = devId;
        this.boxId = boxId;
        this.bindSw1 = bindSw1;
        this.bindSw2 = bindSw2;
        this.regionId = regionId;
        // if (devType == DeviceList.TYPE_SWITCH)
        // swBindAddrList = new ArrayList();
    }

    public DeviceDb(String boxId, String gwDevId, String devId, String devName,
                    int netType, int devType, String mac, String bindSw1,
                    String bindSw2, int regionId, String devCfg) {
        this.name = devName;
        this.type = devType;
        this.netType = netType;
        this.macAddr = mac;
        // this.netAddr = netAddr;
        this.devId = devId;
        this.boxId = boxId;
        this.bindSw1 = bindSw1;
        this.bindSw2 = bindSw2;
        this.regionId = regionId;
        this.gwDevId = gwDevId;
        this.devCongfigure = devCfg;
        // if (devType == DeviceList.TYPE_SWITCH)
        // swBindAddrList = new ArrayList();
    }

    /**
     * 区域ID
     *
     * @return
     */
    public int getRegionId() {
        return regionId;
    }

    public void setRegionId(int regionId) {
        this.regionId = regionId;
    }

    public void setBoxId(String id) {
        boxId = id;
    }

    public String getBoxId() {
        return boxId;
    }

    public void setDevId(String s) {
        this.devId = s;
    }

    public String getDevId() {
        return devId;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setMacAddr(String macAddr) {
        this.macAddr = macAddr;
    }

    public String getMacAddr() {
        return macAddr;
    }

    public void setNetType(int n) {
        this.netType = n;
    }

    public int getNetType() {
        return netType;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public void setStatus(int s) {
        status = s;
    }

    public int getStatus() {
        return status;
    }

    public void setSw(int s) {
        this.sw = s;
    }

    public int getSw() {
        return sw;
    }

    public void setBrightness(int brgness) {
        brightness = brgness;
    }

    public int getBrightness() {
        return brightness;
    }

    public void setColor(int c) {
        color = c;
    }

    public int getColor() {
        return color;
    }

    public void setDimmer(int f) {
        dimmer = f;
    }

    public int getDimmer() {
        return dimmer;
    }

    public void setCurtainState(int s) {
        runstate = s;
    }

    public int getCurtainState() {
        return runstate;
    }

    public void setCurtainState2(int s) {
        runstate2 = s;
    }

    public int getCurtainState2() {
        return runstate2;
    }

    public void setMode(int m) {
        mode = m;
    }

    public int getMode() {
        return mode;
    }

    public void setSetTemp(int t) {
        temperature = t;
    }

    public int getSetTemp() {
        return temperature;
    }

    public void setWind(int w) {
        wind = w;
    }

    public int getWind() {
        return wind;
    }

    public void setWipe(int w) {
        wipe = w;
    }

    public int getWipe() {
        return wipe;
    }

    public void setPir(int p) {
        pir = p;
    }

    public int getPir() {
        return pir;
    }

    public void setAmbientLight(int a) {
        ambientLight = a;
    }

    public int getAmbientLight() {
        return ambientLight;
    }

    public void setTEMP(int t) {
        TEMP = t;
    }

    public int getTEMP() {
        return TEMP;
    }

    public void setHumidity(int h) {
        HUM = h;
    }

    public int getHumidity() {
        return HUM;
    }

    public void setCO2(int c) {
        CO2 = c;
    }

    public int getCO2() {
        return CO2;
    }

    public void setVOC(int v) {
        VOC = v;
    }

    public int getVOC() {
        return VOC;
    }

    public void setPM25(int pm) {
        PM25 = pm;
    }

    public int getPM25() {
        return PM25;
    }

    public void setAsMag(int b) {
        state = b;
    }

    public int getAsMag() {
        return state;
    }

    public void setInfrared(String s) {
        devCongfigure = s;
    }

    public String getInfrared() {
        return devCongfigure;
    }

    public void setDevCfg(String s) {
        devCongfigure = s;
    }

    public String getDevCfg() {
        return devCongfigure;
    }

    public void setBindSw1(String s) {
        bindSw1 = s;
    }

    public String getBindSw1() {
        return bindSw1;
    }

    public void setBindSw2(String s) {
        bindSw2 = s;
    }

    public String getBindSw2() {
        return bindSw2;
    }

    public int getRetryCnt() {
        return retryCnt;
    }

    public void setRetryCnt(int retryCnt) {
        this.retryCnt = retryCnt;
    }

    public int getFbFlag() {
        return fbFlag;
    }

    public void setFbFlag(int fbFlag) {
        this.fbFlag = fbFlag;
    }

    /*
     * public void setSub1Scene(String s) {sub1Scene = s;} public String
     * getSub1Scene() {return sub1Scene;} public void setSub2Scene(String s)
     * {sub2Scene = s;} public String getSub2Scene() {return sub2Scene;} public
     * void setSub3Scene(String s) {sub3Scene = s;} public String getSub3Scene()
     * {return sub3Scene;} public void setSub4Scene(String s) {sub4Scene = s;}
     * public String getSub4Scene() {return sub4Scene;}
     */

    /*
     * public void setSub1Mode(int m) {sub1mode = m;} public int getSub1Mode()
     * {return sub1mode;} public void setSub2Mode(int m) {sub2mode = m;} public
     * int getSub2Mode() {return sub2mode;}
     */

    public String getGwDevId() {
        return gwDevId;
    }

    public void setGwDevId(String gwDevId) {
        this.gwDevId = gwDevId;
    }

    public String toStringSimple() {
        return String
                .format("name=%s, devId=%s, mac=%s, type=%d, net=%d, bind1=%s, bind2=%s",
                        name, devId, macAddr, type, netType, bindSw1, bindSw2);
    }
}
